﻿/// <reference path="../GeneratedArtifacts/viewModel.js" />

myapp.BrowseAnimals.created = function (screen) {
    // Write code here.
    if (screen.AnimalArchived != 1)
    {
        screen.details.displayName = "Not Adopted"
    };
    screen.getCanUpdateAnimal().then(function success() {
        screen.findContentItem("AddAnimal").isEnabled = true;
    }, function error() {
        screen.findContentItem("AddAnimal").isEnabled = false;
    });

};
myapp.BrowseAnimals.Refresh_execute = function (screen) {
    // Write code here.
    screen.getAnimals().then(function (animals) {
        animals.refresh();
    });
};
myapp.BrowseAnimals.Animals_selectedItem_Photo_Tap_execute = function (screen) {
    // Write code here.
    screen.closePopup();
};